import socket

# 创建一个UDP套接字
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

# 设置套接字为广播类型
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)

# 广播地址
broadcast_address = '10.194.194.255'
port = 9999

# 发送的消息
message = "Hello, this is a broadcast message"

# 发送广播消息
sock.sendto(message.encode(), (broadcast_address, port))

# 关闭套接字
sock.close()